package cn.shengchao.examstar.ai.application.dto;

import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * 学习计划摘要数据传输对象
 * 用于首页展示学习计划总体情况
 */
@Data
@Builder
public class StudyPlanSummaryDTO {
    
    /**
     * 类目ID
     */
    private String specificationTypeId;
    
    /**
     * 类目名称
     */
    private String specificationTypeName;
    
    /**
     * 用户ID
     */
    private String userId;
    
    /**
     * 知识点总数
     */
    private Integer totalKnowledgePoints;
    
    /**
     * 已学习知识点数
     */
    private Integer learnedKnowledgePoints;
    
    /**
     * 总学习时长(分钟)
     */
    private Integer totalStudyTimeMinutes;
    

    /**
     * 总体掌握程度(百分比)
     */
    private Double masteryPercentage;
    
    /**
     * 掌握程度描述
     * S-精通, A-掌握, B-理解, C-初步了解
     */
    private String masteryLevel;

    /**
     * 是否有学习计划
     */
    private Boolean hasStudyPlan;
    
    /**
     * 最薄弱的知识点(最多2个)
     */
    private List<KnowledgePointDTO> weakestKnowledgePoints;
    
    /**
     * AI分析的学习建议
     */
    private String learningRecommendation;
    
    /**
     * 计算学习进度百分比
     */
    public Double getProgressPercentage() {
        if (totalKnowledgePoints == null || totalKnowledgePoints == 0) {
            return 0.0;
        }
        return (double) learnedKnowledgePoints * 100 / totalKnowledgePoints;
    }
} 